package org.lwxyz.utils.number;

/**
 * @description
 * @author yuwei
 * @version 1.0-SNAPSHOT
 * @date 2018/1/29
 */
public class NumberUtil {
    /**
     * 去掉字符串数字后面多余的0
     * @param s
     * @return
     */
    public static String subZeroAndDot(String s){
        if(s.indexOf(".") > 0){
            s = s.replaceAll("0+?$", "");//去掉多余的0
            s = s.replaceAll("[.]$", "");//如最后一位是.则去掉
        }
        return s;
    }
}
